const mongoose = require('mongoose')
const passportLocalMongoose = require('passport-local-mongoose')


mongoose.connect('mongodb://admin:pass@127.0.0.1:27000/demo', { authSource: 'admin' }, (err) => {
    if (err) console.log('连接失败')
    else console.log('连接成功')
})

const userSchema = new mongoose.Schema({
    lastname: {
        type: String
    }
})

userSchema.plugin(passportLocalMongoose)

const User = mongoose.model('User', userSchema)
module.exports = User